A Gentle Introduction to Julia for Data Analysis

Tyler J. Brough

2025-04-23

A Gentle Introduction to Julia

Agenda

  1. Computational Exercises for Simple Stopping Rules
    • The chicken nuggets problem
    • Guess my number
  2. An Introduction to Prezo.jl
    • Creating a new module
    • REPL processes
    • Multiple file layout
    • Loading your module for testing
    • Julia’s type system and type hierarchies
    • Multiple dispatch

Installing Julia



Go to: https://julialang.org/

The Chicken Nuggets Problem

This problem is known as the chicken nuggets problem (or sometimes the coins problem). It goes like this: you walk into Chick Fil-A with an unlimited budget (and appetite!). You can purchase nuggets in boxes of 6, 9, and 20 pieces.

Write a program to tell you the highest number of nuggets that you cannot purchase. Re-read that just in case it went past you the first time. The highest number that you cannot get. For example, you can get 15 nuggets by purchasing a box of 6 and a box of 9 nuggets. You can get 18 by purchasing 2 boxes of 9 or 3 boxes of 6. But with no combination of 6, 9, or 20 can you purchase 17 nuggets. What is the highest number that you cannot get?

This simple game will give you experience assembling different bits of Julia programming to find the solution. The most direct approach and simplest approach will also employ a very simple numerical method called brute force search.

Guess My Number

In the book Python Programming for the Absolute Beginner, 3rd Edition the author teaches Python through some simple games programming. One of the first games that he shows how to write is the so-called Guess My Number game, which is the children’s game of guessing someone’s secrete number (a number between 1 and 100).

Let’s see what this looks like in Julia!

Let’s Take a Look at Prezo.jl

Summary



Thank you!